/*
Automatic clinic tests using a robot arm.
Copyright (C) 2010  CIC-CPC, CHU Gabriel Montpied
All other trademarks, logos and copyrights are the property
of their respective owners.

This file is part of cpc-painbot.

cpc-painbot is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

cpc-painbot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with cpc-painbot.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef VONFREY_H
#define VONFREY_H

#include "stimulateur.h"

#include "filament.h"

/*! Stimulation de type Von Frey.
    Effectue une stimulation en Von Frey statique.
    \p Après avoir défini une Zone de travail, une stimulation se déroule de la manière suivante :
    \li Le Bras va chercher un Filament.
    \li Le Filament est posé sur un point de la Zone
    \li Le Filament retourne sur le Rack.
*/
class VonFrey : public Stimulateur
{
Q_OBJECT
//! Filament stimulant.
Q_PROPERTY(Filament* filament READ filament WRITE setFilament)
public:
    //! Constructeur.
    explicit VonFrey(QObject *parent = 0);

    //! Filament utilisé.
    Filament *filament() const { return qobject_cast<Filament*>(outil()); }

signals:

public slots:
    /*! Définit le Filament.
        \param filament Filament stimulant.
    */
    void setFilament(Filament *filament) { setOutil(filament); }

protected:
    virtual void refaireTransitions();

protected slots:

    void placerDevantFilament();
    void placerSousFilament();
    void attraperFilament();
    void remettreFilament();
    void degagerFilament();

    /*! Place le Filament au dessus du point choisi.
        \param[in] position La position choisie.
    */
    void placerFilament();

    /*! Pose le Filament.
        Pose le Filament sur le point donné pendant un certain temps.
        \param[in] position La position où poser le Filament.
    */
    void poserFilament();

    /*! Relève le Filament. */
    void releverFilament();

protected:
    Filament *filament_; //!< Filament stimulant.
};

#endif // VONFREY_H
